﻿using System;
using System.Web.Services;

namespace HelloWorld.Web
{
    /// <summary>
    /// Summary description for DoSomethingService
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class DoSomethingService : System.Web.Services.WebService
    {

        [WebMethod]
        public string DoSomething(string todo)
        {
            System.Threading.Thread.Sleep(5000);
            string result;

            switch (todo)
            {
                case "eat":
                    result = "You ate a giant meatball";
                    break;
                case "sleep":
                    result = "You took a nap on the couch all day";
                    break;
                case "drink":
                    result = "You drank a quart of cola";
                    break;
                case "bemerry":
                    result = "You watched an episode of Seinfeld";
                    break;
                case "all":
                    result = "You did it all today!";
                    break;
                default:
                    result = "Error, I don't know what " + todo + "] is!";
                    break;
            }

            return result;
        }
    }
}
